﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Argos.WMI;
using System.IO;
using System.Management;

namespace Argos.Core.Tests
{
	[TestClass]
	public class WMITests
	{

		#region public TestContext TestContext { get; set; }

		private TestContext testContextInstance;

		/// <summary>
		///Gets or sets the test context which provides
		///information about and functionality for the current test run.
		///</summary>
		public TestContext TestContext
		{
			get
			{
				return testContextInstance;
			}
			set
			{
				testContextInstance = value;
			}
		}

		#endregion



		#region Test: public void GetLogicalDisks01()

		[global::Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute()]
		[global::Microsoft.VisualStudio.TestTools.UnitTesting.DescriptionAttribute(" ")]
		public void GetLogicalDisks01()
		{
			var drives = DriveInfo.GetDrives();
			var disks = LogicalDisk.GetDisks();

			Assert.IsNotNull(disks);
			Assert.AreEqual<int>(drives.Length, disks.Count);

			for (int i = 0; i < drives.Length; i++)
			{
				Assert.AreEqual<string>(drives[i].Name, string.Format(@"{0}:\", disks[i].DriveLetter));
			}

		}

		#endregion

		#region Test: public void GetLogicalDisks02()

		[global::Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute()]
		[global::Microsoft.VisualStudio.TestTools.UnitTesting.DescriptionAttribute(" ")]
		public void GetLogicalDisks02()
		{
			var disks = LogicalDisk.GetDisks(Environment.MachineName);
			Assert.IsNotNull(disks);
		}

		#endregion

		#region Test: public void GetLogicalDisks03()

		[global::Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute()]
		[global::Microsoft.VisualStudio.TestTools.UnitTesting.DescriptionAttribute(" ")]
		public void GetLogicalDisks03()
		{
			var disks = LogicalDisk.GetDisks(Environment.MachineName, new ConnectionOptions());
			Assert.IsNotNull(disks);
		}

		#endregion
		
	}
}
